<?
	session_start();	

	require("connect.inc.php");
	($db = mysql_connect("$serveur", "$utilisateur", "$motdepasse")) or die("<CENTER><A style='color:white;background-color:red'> D�ol� probl�e de serveur</a><br><br>Impossible de se connecter au serveur</center><br></td></tr></table></body></html>");
	mysql_select_db("$database",$db) or die("<CENTER><A style='color:white;background-color:red'> D�ol� probl�e de serveur</a><br><br>Impossible de se connecter �la base de donn�s</center><br></td></tr></table></body></html>");
	
	require('include/fonctions_bd.php');
	require('include/fonctions.php');
	
	 $err_log = "";
	 
	 if(isset($_POST['login'])) {
		$login = $_POST['login'];
		
		if(getNbLogin($login) == 1) {
			$passwd = getPasswdByLogin($login);
			if(md5($_POST['passwd']) == $passwd) {
				session_register('login');
			} else {
				$err_log = "<FONT color=red><B>Mauvais mot de passe</B></FONT><BR /><BR />";	
			}
		} else {
			$err_log = "<FONT color=red><B>Ce login n'existe pas</B></FONT><BR /><BR />";	
		}
	 }
	
	 if(isset($_GET['action'])) {
		 if($_GET['action']=='unlog')
	 		session_unregister('login');
 	 }
	 	
	 if(session_is_registered('login')) {
		 $login = $_SESSION['login'];
	 }
?>

<HTML>
<HEAD>
<TITLE>Roule Maboule, la jongle orvaltaise</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK rel="stylesheet" href="css/style.css" type="text/css" />

</HEAD>
<BODY BGCOLOR=#000000 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<DIV class="haut">
<TABLE WIDTH=800 BORDER=0 CELLPADDING=0 CELLSPACING=0>
	<TR>
		<TD><IMG SRC="images/Design_01.gif" WIDTH=20 HEIGHT=102 ALT=""></TD>
		<TD background="images/Design_02.gif" WIDTH=760 HEIGHT=102 valign="bottom" align="right" class="menu">
		<A HREF="index.php?page=body_accueil">Accueil</A> | 
		<A HREF="index.php?page=galerie">Galerie</A> | 
		<A HREF="http://roulemaboule.free.fr/forum/" target="_blank">Forum</A> | 
		<A HREF="index.php?page=articles">Articles</A> | 
		<A HREF="index.php?page=agenda">L'Agenda</A> | 
		<A HREF="index.php?page=liens">Liens</A> | 
		<A HREF="index.php?page=contacts">Contacts</A>
		</TD>
		<TD><IMG SRC="images/Design_03.gif" WIDTH=20 HEIGHT=102 ALT=""></TD>
	</TR>
	<TR>
		<TD><IMG SRC="images/Design_04.gif" WIDTH=20 HEIGHT=60 ALT=""></TD>
		<TD background="images/Design_05.gif" WIDTH=760 HEIGHT=60 align="left" valign="bottom">
		<? 	if ($page != "body_accueil") {
			echo "<IMG SRC='images/".$page.".png'>"; 
			}
			
		?>
		</TD>
		<TD><IMG SRC="images/Design_06.gif" WIDTH=20 HEIGHT=60 ALT=""></TD>
	</TR>
	<TR>
		<TD background="images/Design_07.gif" WIDTH=20></TD>
		<TD bgcolor="white" WIDTH=760>